﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FX_API.Models;

namespace FX_API.Factory
{
    public static class UpdateModelFactory
    {
        public static FXUpdateRequestModel CreateUpdateModel(IObjectData objectData, bool triggerWorkFlow)
        {
            return new FXUpdateRequestModel()
            {
                corpAccessToken = FenxiangAPI.corpAccessToken,
                corpId = FenxiangAPI.corpId,
                currentOpenUserId = FenxiangAPI.openUserId,
                triggerWorkFlow = triggerWorkFlow,
                data = new UpdateData() { object_data = objectData }
            };
        }

        public static FXUpdateRequestModel CreateUpdateModelWithDetails(IObjectData objectData, object details, bool triggerWorkFlow)
        {
            return new FXUpdateRequestModel()
            {
                corpAccessToken = FenxiangAPI.corpAccessToken,
                corpId = FenxiangAPI.corpId,
                currentOpenUserId = FenxiangAPI.openUserId,
                triggerWorkFlow = triggerWorkFlow,
                data = new UpdateData()
                {
                    details = details,
                    object_data = objectData
                }
            };
        }
    }
}
